package com.jh.user.pojo;

import cn.jh.common.tools.Strings;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

import static cn.jh.common.tools.Strings.*;

@Entity
@Table(name="t_bank_branch")
public class BankBranch implements Serializable{

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="id")
	private int id;
	
	@Column(name="bank_no")
	private String bankNo;
	
	@Column(name="bank_name")
	private String bankName;
	
	@Column(name="top_no")
	private String topNo;
	
	@Column(name="top_name")
	private String topName;
	
	@Column(name = "province_id")
	private String provinceId;

	@Column(name = "city_id")
	private String cityId;

	@Column(name = "province")
	private String province;

	@Column(name = "city")
	private String city;
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getBankNo() {
		return bankNo;
	}

	public void setBankNo(String bankNo) {
		this.bankNo = bankNo;
	}

	public String getBankName() {
		return bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	public String getTopNo() {
		return topNo;
	}

	public void setTopNo(String topNo) {
		this.topNo = topNo;
	}

	public String getTopName() {
		return topName;
	}

	public void setTopName(String topName) {
		this.topName = topName;
	}

	public String getProvinceId() {
		return provinceId;
	}

	public void setProvinceId(String provinceId) {
		this.provinceId = provinceId;
	}

	public String getCityId() {
		return cityId;
	}

	public void setCityId(String cityId) {
		this.cityId = cityId;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	@Override
	public String toString() {
		return "BankBranch{" +
				"id=" + id +
				", bankNo='" + bankNo + '\'' +
				", bankName='" + bankName + '\'' +
				", topNo='" + topNo + '\'' +
				", topName='" + topName + '\'' +
				", provinceId='" + provinceId + '\'' +
				", cityId='" + cityId + '\'' +
				", province='" + province + '\'' +
				", city='" + city + '\'' +
				'}';
	}

	public boolean isNeedProcess() {
		return isNullOrEmpty(getCity()) || isNullOrEmpty(getProvince())
				|| isNullOrEmpty(getCityId()) || isNullOrEmpty(getProvinceId());
	}
}
